package com.tx.schedule.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Table(name = "SYS_SCHEDULE_JOB")
public class ScheduleJob implements Serializable {
	private static final long serialVersionUID = -6268330198581041868L;
	public static final String STATUS_ENABLE="Y";
	public static final String STATUS_DISABLE="N";
	public static final String STATUS_DELETE="D";
	
	public static final String IS_SPRING_YES="Y";
	public static final String IS_SPRING_NO="N";

	/** 任务ID */
	@Id
	@GeneratedValue(generator = "UUID")
	@Column(name = "JOB_ID", length = 32)
	private String jobId;

	/** 任务名称 */
	@Column(name = "JOB_NAME", length = 20, nullable = false)
	private String jobName;

	/** 任务分组 */
	@Column(name = "JOB_GROUP", length = 20, nullable = false)
	private String jobGroup;

	/** 任务状态 0禁用 1启用 2删除 */
	@Column(name = "JOB_STATUS", length = 2, nullable = false)
	private String jobStatus;

	/** 任务运行时间表达式 */
	@Column(name = "CRON_EXPRESSION", length = 30, nullable = false)
	private String cronExpression;

	/** 任务描述 */
	@Column(name = "DESCRIPTION", length = 100)
	private String description;

	/** 任务类 spring bean id */
	@Column(name = "TARGET_OBJECT", length = 20)
	private String targetObject;

	/** 任务方法 */
	@Column(name = "TARGET_METHOD", length = 20, nullable = false)
	private String targetMethod;

	/** 是否是Spring中定义的Bean */
	@Column(name = "IS_SPRINGBEAN", length = 2)
	private String isSpringBean;

	/** 如果isSpringBean = N需要设置全类名,测试CLAZZ字段需要配置 */
	@Column(name = "CLAZZ", length = 50)
	private String clazz;

	/** 是否并发 N禁用 Y启用 */
	@Column(name = "CONCURRENT", length = 2, nullable = false)
	private String concurrent = "N";

	/** 一系列的子任务,逗号分开,表示该任务执行完，之后需要执行的任务 */
	@Column(name = "CHILD_JOBS", length = 100)
	private String childJobs;

	/** 运行一次 */
	@Transient
	private Boolean runOnce;

	public String getJobId() {
		return jobId;
	}

	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobGroup() {
		return jobGroup;
	}

	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	public String getJobStatus() {
		return jobStatus;
	}

	public void setJobStatus(String jobStatus) {
		this.jobStatus = jobStatus;
	}

	public String getCronExpression() {
		return cronExpression;
	}

	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getTargetObject() {
		return targetObject;
	}

	public void setTargetObject(String targetObject) {
		this.targetObject = targetObject;
	}

	public String getTargetMethod() {
		return targetMethod;
	}

	public void setTargetMethod(String targetMethod) {
		this.targetMethod = targetMethod;
	}

	public String getIsSpringBean() {
		return isSpringBean;
	}

	public void setIsSpringBean(String isSpringBean) {
		this.isSpringBean = isSpringBean;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	public String getConcurrent() {
		return concurrent;
	}

	public void setConcurrent(String concurrent) {
		this.concurrent = concurrent;
	}

	public String getChildJobs() {
		return childJobs;
	}

	public void setChildJobs(String childJobs) {
		this.childJobs = childJobs;
	}

	public Boolean isRunOnce() {
		return runOnce;
	}

	public void setRunOnce(Boolean runOnce) {
		this.runOnce = runOnce;
	}

}
